<?php
include_once '../Class/DB.php';
$db=new DB();
$tid=$_GET["id"];
$theType=$db->get_tid_types($tid);
$newName=$_GET["newName"];
$db->update_tid_name($tid,$newName);
if($theType[0]["parent"]==0){
?>
<script language="JavaScript">
window.location.href="classifyList.php";
</script>
<?php 
}else{
?>
<script language="JavaScript">
var ptid='<?php print_r($theType[0]["parent"]);?>';
window.location.href="s_classesList.php?id="+ptid;
</script>
<?php 
}
?>